var t = getApp(), e = t.requirejs('core'), a = t.requirejs("foxui");
Page({
    data: {
        submit: !1,
        member:[],
        title:''
    },
    onShow(){
        e.get("yam/bzchange/getbasic", {}, res => {
            console.log(res);
            this.setData({
                member: res.member
            })
        })
    },
    onLoad(s){
      this.setData({
          title: s.title
      })
      wx.setNavigationBarTitle({
          title: s.title,
      })
    },
    // 提交
    submit(s) {
        let data = s.detail.value;
        if (!this.data.submit) {
            if(!data.money) {
                wx.showToast({
                    title: '请输入转换的金额',
                    icon: 'none'
                })
                return
            }
            console.log(data);
            e.get("yam/bzchange/change", data, res => {
                console.log(res);
                if(0 == res.error){
                    this.setData({
                        submit: !1
                    });
                    wx.showToast({
                        title: '转换成功',
                        icon:'none'
                    })
                    setTimeout(function() {
                        wx.navigateBack();
                    }, 2000)
                }else{
                    wx.showToast({
                        title:res.message,
                        icon:'none'
                    })
                }
            })
        }
    }
})